import time
from multiprocessing import Pool
count = 0


def f(x):
    time.sleep(1)
    return x*x


def call_back(res):
    print(res)


if __name__ == '__main__':
    process = []
    pool = Pool(processes=4)
    for j in range(8*4):
        result = pool.apply_async(f, (j,), callback=call_back)
        process.append(result)
    pool.close()
    pool.join()
